// MIR for `filter_mapped` after PreCodegen

fn filter_mapped(_1: impl Iterator<Item = T>, _2: impl Fn(T) -> Option<U>) -> () {
    debug iter => _1;
    debug f => _2;
    let mut _0: ();
    let mut _3: std::iter::FilterMap<impl Iterator<Item = T>, impl Fn(T) -> Option<U>>;
    let mut _4: std::iter::FilterMap<impl Iterator<Item = T>, impl Fn(T) -> Option<U>>;
    let mut _5: &mut std::iter::FilterMap<impl Iterator<Item = T>, impl Fn(T) -> Option<U>>;
    let mut _8: std::option::Option<U>;
    let mut _9: isize;
    let _11: ();
    scope 1 {
        debug iter => _4;
        let _10: U;
        scope 2 {
            debug x => _10;
        }
        scope 4 (inlined <FilterMap<impl Iterator<Item = T>, impl Fn(T) -> Option<U>> as Iterator>::next) {
            debug self => _5;
            let mut _6: &mut impl Iterator<Item = T>;
            let mut _7: &mut impl Fn(T) -> Option<U>;
        }
    }
    scope 3 (inlined <FilterMap<impl Iterator<Item = T>, impl Fn(T) -> Option<U>> as IntoIterator>::into_iter) {
        debug self => _3;
    }

    bb0: {
        _3 = <impl Iterator<Item = T> as Iterator>::filter_map::<U, impl Fn(T) -> Option<U>>(move _1, move _2) -> [return: bb1, unwind continue];
    }

    bb1: {
        StorageLive(_4);
        _4 = _3;
        goto -> bb2;
    }

    bb2: {
        StorageLive(_8);
        _5 = &mut _4;
        StorageLive(_6);
        _6 = &mut (_4.0: impl Iterator<Item = T>);
        StorageLive(_7);
        _7 = &mut (_4.1: impl Fn(T) -> Option<U>);
        _8 = <impl Iterator<Item = T> as Iterator>::find_map::<U, &mut impl Fn(T) -> Option<U>>(move _6, move _7) -> [return: bb3, unwind: bb9];
    }

    bb3: {
        StorageDead(_7);
        StorageDead(_6);
        _9 = discriminant(_8);
        switchInt(move _9) -> [0: bb4, 1: bb6, otherwise: bb8];
    }

    bb4: {
        StorageDead(_8);
        drop(_4) -> [return: bb5, unwind continue];
    }

    bb5: {
        StorageDead(_4);
        return;
    }

    bb6: {
        _10 = move ((_8 as Some).0: U);
        _11 = opaque::<U>(move _10) -> [return: bb7, unwind: bb9];
    }

    bb7: {
        StorageDead(_8);
        goto -> bb2;
    }

    bb8: {
        unreachable;
    }

    bb9 (cleanup): {
        drop(_4) -> [return: bb10, unwind terminate(cleanup)];
    }

    bb10 (cleanup): {
        resume;
    }
}
